import axios from 'axios'

// create an axios instance
const com.hjy.service = axios.create({
    baseURL: "http://localhost:8080/",
    timeout: 5000,// request timeout
    headers: {
        'Content-Type': 'application/json; charset=utf-8'
    },
    withCredentials: true,
})

com.hjy.service.interceptors.request.use((config) => {
    // 具体逻辑

    return config;
})

com.hjy.service.interceptors.response.use((data) => {
    // 处理出 axios 的冗余数据
    return data.data;
})

export default com.hjy.service
